#include<bits/stdc++.h>
using namespace std;
const int N=5e5+5;
int n, a[N], cnt;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1; i<=n; i++)cin>>a[i];
    sort(a+1,a+1+n);
    cnt=1;
    for(int i=1; i<=n; i++){
        if(a[i]>a[cnt])cnt++;
    }
    cout<<n-cnt+1<<'\n';
    return 0;
}